home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / COMMS / IRCMACRO.ZIP / !IRCMacro / !RunImage (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1996-08-05  |  10KB  |  450 lines

  1.  IRC Macro Tool
  2.  By Rich Goodwin
  3. " at line ";
  4. Task$="IRCMacro"
  5. "Purpose$="easier IRC chatting"
  6. %Author$=
  7. (169)+" Richard Goodwin"
  8.     +Version$="1.00"+
  9. (223)+" (August 1996)"
  10.  quit
  11. saveoptions 
  12. $(block%)="TASK"
  13. "Wimp_CloseDown",taskhandle,!block%
  14. quit=0
  15. pumping=0
  16.  block% 256
  17.  menublock% 256
  18.  "Wimp_Initialise",200,&4B534154,Task$ 
  19.  ,taskhandle
  20.  "Wimp_OpenTemplate",,"IRCMacro:Resources.Templates"
  21.  "Wimp_LoadTemplate",,,,,,"Info" 
  22.  ,templen,worklen
  23.  info templen,infowork worklen
  24.  "Wimp_LoadTemplate",,info,infowork,infowork+worklen,-1,"Info",0
  25.  "Wimp_LoadTemplate",,,,,,"Effects" 
  26.  ,templen,worklen
  27.  effect templen,effectwork worklen
  28.  "Wimp_LoadTemplate",,effect,effectwork,effectwork+worklen,-1,"Effects",0
  29.  "Wimp_LoadTemplate",,,,,,"Characters" 
  30.  ,templen,worklen
  31.  char templen,charwork worklen
  32.  "Wimp_LoadTemplate",,char,charwork,charwork+worklen,-1,"Characters",0
  33.  "Wimp_LoadTemplate",,,,,,"IRCMacros" 
  34.  ,templen,worklen
  35.  ircmacro templen,ircmacrowork worklen
  36.  "Wimp_LoadTemplate",,ircmacro,ircmacrowork,ircmacrowork+worklen,-1,"IRCMacros",0 
  37.  "Wimp_LoadTemplate",,,,,,"Choices" 
  38.  ,templen,worklen
  39.  choice templen,choicework worklen
  40.  "Wimp_LoadTemplate",,choice,choicework,choicework+worklen,-1,"Choices",0
  41.  "Wimp_CloseTemplate"
  42.  "Wimp_CreateWindow",,info 
  43.  infohandle
  44.  "Wimp_CreateWindow",,ircmacro 
  45.  ircmacrohandle
  46. DefineIRCMacros
  47. iconbar
  48. version
  49. defineoptions
  50.  IRCMacroOpen=
  51. openircmacro
  52. iconbar
  53. !block%=-1
  54. block%!4=0
  55. block%!8=0
  56. block%!12=68
  57. block%!16=68
  58. block%!20=&201A
  59. $(block%+24)="!IRCMacro"
  60.  "Wimp_CreateIcon",,block% 
  61.  iconbarhandle
  62. version
  63. !block%=infohandle
  64. block%!4=1
  65. "Wimp_GetIconState",,block%
  66. $(block%!28)=Task$ 
  67. !block%=infohandle
  68. block%!4=2
  69. "Wimp_GetIconState",,block%
  70. $(block%!28)=Purpose$  
  71. !block%=infohandle
  72. block%!4=3
  73. "Wimp_GetIconState",,block%
  74. $(block%!28)=Author$
  75. !block%=infohandle
  76. block%!4=4
  77. "Wimp_GetIconState",,block%
  78. $(block%!28)=Version$
  79. makeiconmenu(X)
  80. $(menublock%)=Task$
  81. menublock%!12=&00070207
  82. menublock%!16=182
  83. menublock%!20=44
  84. menublock%!24=0
  85. menublock%!28=2
  86. menublock%!32=infohandle
  87. menublock%!36=&7000001
  88. $(menublock%+40)="Info"
  89. menublock%!52=2
  90. a menublock%!56=ircmacrohandle
  91. menublock%!60=&7000001
  92. $(menublock%+64)="Macros"
  93. menublock%!76=0
  94. menublock%!80=0
  95. menublock%!84=&7000001
  96. $(menublock%+88)="Reload" 
  97. menublock%!100=2
  98. menublock%!104=0
  99. menublock%!108=&7000001
  100. $(menublock%+112)="Save"
  101. menublock%!124=&80
  102. menublock%!128=-1
  103. menublock%!132=&7000001
  104. $(menublock%+136)="Quit"
  105. "Wimp_CreateMenu",,menublock%,X,370
  106. openircmacro
  107. !block%=ircmacrohandle
  108. "Wimp_GetWindowState",,block%
  109. block%!28=-1
  110. "Wimp_OpenWindow",,block%
  111. IRCMacroOpen=
  112. "Wimp_Poll",0,block% 
  113.  reason,handle
  114.  reason 
  115.  1 : 
  116. "Wimp_RedrawWindow",,block%
  117.  2 : 
  118. "Wimp_OpenWindow",,block%
  119.  3 : 
  120. ClosingWindows
  121.  6 : 
  122. mouseclick(block%)
  123.  9 : 
  124. menuselect(block%)
  125.  17,18 :
  126. message(block%)
  127. ClosingWindows
  128.  handle!0=ircmacrohandle 
  129.  IRCMacroOpen=
  130. "Wimp_CloseWindow",,block%
  131. mouseclick(bl)
  132.  bl!12=-2 
  133. oniconbar
  134.  bl!12=ircmacrohandle 
  135. ClickOnIRCMacro
  136. oniconbar
  137.  bl!8=4 
  138.  bl!16=iconbarhandle 
  139. openircmacro
  140.  bl!8=1 
  141.  bl!16=iconbarhandle 
  142. "XOS_CLI","Filer_Run <IRCMacroScripts$Dir>.Script"
  143.  bl!8=2 
  144.  bl!16=iconbarhandle 
  145. makeiconmenu(!bl-64)
  146. message(bl)
  147.  bl!16 
  148.  0 : quit=-1
  149.  3 : 
  150. fileinsert
  151.  &502: 
  152. menuselect(bl)
  153.  !bl 
  154. "XOS_CLI","Filer_OpenDir IRCMacro:Resources.^"
  155. openircmacro
  156. LoadIRCMacros("<IRCMacroScripts$Dir>.Script"):
  157. RedrawWindows 
  158. SaveIRCMacros 
  159.  4: quit=-1
  160. push(pump$)
  161. pumping=1
  162. (pump$)=0 
  163. character=
  164. pump$,X,1))
  165. "OS_Byte",138,0,character
  166.  5=0 
  167.  character=10 
  168.  character=13 
  169.  character=32 
  170. (pump$)
  171. pumping=0
  172. zero(number%)
  173.  number%<=9 
  174.  number%>=0 
  175.  ="0" 
  176. DefineIRCMacros
  177.  loop%
  178.  ircmacro$(12)
  179. +ircmacro$(02)="/away for a while"+
  180. DoIRCMacroString(1,"Away for a while")
  181. ircmacro$(03)="/away"+
  182. DoIRCMacroString(2,"Away")
  183. 0ircmacro$(04)="/me is doing something"+
  184. DoIRCMacroString(3,"I'm doing something")
  185. ircmacro$(05)="Hiya"
  186. DoIRCMacroString(4,"Hiya")
  187. ircmacro$(06)="/topic"
  188. DoIRCMacroString(5,"topic")
  189.  ircmacro$(07)="/clear"+
  190. DoIRCMacroString(6,"Clear")
  191. &ircmacro$(08)="/list -Min 5"+
  192. DoIRCMacroString(7,"List 5 minutes")
  193. ircmacro$(09)="/who"+
  194. DoIRCMacroString(8,"Who")
  195. ircmacro$(01)="/help"+
  196. DoIRCMacroString(0,"Help")
  197. 4ircmacro$(10)="/quit to do something else"+
  198. DoIRCMacroString(9,"Leave")
  199. DoIRCMacroString(10," ")
  200. ircmacro$(11)=""
  201. DoIRCMacroString(11,"IRCMacro by R. Goodwin")
  202. Bircmacro$(12)="/me is using IRCMacro by Richard Goodwin"+
  203. LoadIRCMacros("<IRCMacroScripts$Dir>.Script")
  204. DoIRCMacroString(icon,string$)
  205.  icon>12 
  206. (string$)>28 string$=
  207. string$,28)
  208. !block%=ircmacrohandle
  209. block%!4=icon
  210. "Wimp_GetIconState",,block%
  211. $(block%!28)=string$
  212. LoadIRCMacros(inputfile$)
  213.  check%, fileopen, char, var$, macro$, ircmacronumber
  214. "OS_File",5,inputfile$ 
  215.  check%
  216.  check%=0 
  217. fileopen=
  218.  inputfile$
  219. var$=""
  220. char=
  221. #fileopen
  222.  char>96 
  223.  char<123 
  224.  char-=32
  225.  char<>
  226.  char<>10 
  227.  char<>13 
  228.  char<>32 
  229.  char<>0 
  230. (var$)<250 
  231.  var$=var$+
  232. (char)
  233.  char=
  234. #fileopen
  235. #fileopen 
  236. #fileopen:
  237. macro$=""
  238. char=
  239. #fileopen
  240.  char=92 
  241.  macro$=macro$+
  242.  char<>10 
  243.  char<>13 
  244.  char<>
  245. (macro$)<255 
  246.  macro$=macro$+
  247. (char)
  248.  char=10 
  249.  char=13 
  250. #fileopen
  251. ircmacronumber=0
  252.  (var$)=8 
  253. var$,6)="IRCTAG" 
  254.  ircmacronumber=(
  255. var$,2))
  256.  (var$)=8 
  257. var$,6)="IRCDEF" 
  258.  ircmacronumber=(
  259. var$,2))
  260.  (var$)=7 
  261. var$,6)="IRCTAG" 
  262.  ircmacronumber=(
  263. var$,1))
  264.  (var$)=7 
  265. var$,6)="IRCDEF" 
  266.  ircmacronumber=(
  267. var$,1))
  268.  var$="IRCDEF" 
  269.  var$="IRCTAG" var$=""
  270. var$,6)="IRCDEF" 
  271.  ircmacronumber>12 var$=""
  272. var$,6)="IRCTAG" 
  273.  ircmacronumber>12 var$=""
  274. var$,6)="IRCDEF" 
  275.  ircmacronumber<1  var$=""
  276. var$,6)="IRCDEF" 
  277.  ircmacronumber<1  var$=""
  278. var$,6) 
  279.  "IRCTAG": 
  280. DoIRCMacroString(ircmacronumber-1,macro$)
  281.  "IRCDEF": ircmacro$(ircmacronumber)=macro$
  282. #fileopen
  283. #fileopen
  284. ClickOnIRCMacro
  285.  temp$, icon%
  286.  (bl!8 
  287.  4)=1 
  288.  IRCMacroOpen=
  289. "Wimp_CloseWindow",,block%
  290. temp$="":icon%=bl!16
  291.  icon%>=0 
  292.  icon%<=11 
  293.  temp$=ircmacro$(icon%+1)
  294.  temp$="" 
  295.  pumping=0 
  296. push(temp$):
  297.  pumping=1 
  298. (pump$)+
  299. (temp$)>255 
  300. pump$=pump$+temp$:
  301.  help$
  302.  block%!32 
  303.  -2:help$="This is the "+Task$+" icon.|MIt allows "+Purpose$+".|M"
  304.  infohandle:help$=Task$+": Version "+Version$+"|M"+Author$+"|M"
  305.  help$<>"" 
  306. block%!12=block%!8
  307. block%!16=&503
  308. $(block%+20)=help$+
  309. !block%=(25+
  310.  help$) 
  311.  "Wimp_SendMessage",17,block%,block%!4,0
  312. fileinsert
  313.  pos%,temp$
  314. name$="":temp$=""
  315. pos%=0
  316.  ?(bl+44+pos%)<>0
  317. name$+=
  318. (?(bl+44+pos%))
  319. pos%+=1
  320. GetFileType
  321. GetFileInfo
  322.  filetype% 
  323.  &FFF : 
  324. LoadNewDefinitions(name$)
  325.  temp$="" 
  326.  pumping=0 
  327. push(temp$):
  328.  pumping=1 
  329. (pump$)+
  330. (temp$)>255 
  331. pump$=pump$+temp$:
  332. GetFileType
  333.  "OS_File",5,name$ 
  334.  ,,filetype%
  335. 9&filetype%=(filetype% 
  336.  &FFF00)>>>8
  337. GetFileInfo
  338.  pos%,q$,noextension$
  339. pos%=
  340. (name$):file$=""
  341. name$,pos%,1)
  342. pos%-=1
  343.  q$<>"." 
  344.  file$=q$+file$
  345.  q$="."
  346. noextension$="":pos%=0
  347. pos%+=1
  348. file$,pos%,1)
  349.  q$<>"/" noextension$+=q$
  350.  q$="/" 
  351.  pos%>=
  352. (file$)
  353. file$=noextension$
  354. defineoptions 
  355. IRCMacroOpen=
  356. loadoptions
  357. loadoptions
  358. S+inputfile$="IRCMacro:Resources.Options"
  359.  check%, fileopen, char, var$, option$
  360. "OS_File",5,inputfile$ 
  361.  check%
  362.  check%=0 
  363. fileopen=
  364.  inputfile$
  365. var$=""
  366. char=
  367. #fileopen
  368.  char>96 
  369.  char<123 
  370.  char-=32
  371.  char<>
  372.  char<>10 
  373.  char<>13 
  374.  char<>32 
  375.  char<>0 
  376.  var$=var$+
  377. (char)
  378.  char=
  379. #fileopen
  380. #fileopen 
  381. #fileopen:
  382. option$=""
  383. char=
  384. #fileopen
  385.  char>96 
  386.  char<123 
  387.  char-=32
  388.  char<>10 
  389.  char<>13 
  390.  option$=option$+
  391. (char)
  392.  char=10 
  393.  char=13 
  394. #fileopen
  395.  var$="IRCMACROOPEN" 
  396.  option$="YES" 
  397.  IRCMacroOpen=
  398.  var$="IRCMACROOPEN" 
  399.  option$="NO" 
  400.  IRCMacroOpen=
  401. #fileopen
  402. #fileopen
  403. saveoptions
  404. "XOS_CLI","Delete IRCMacro:Resources.Options"
  405. o+fileopen=
  406.  "IRCMacro:Resources.Options"
  407.  IRCMacroOpen=
  408. tofile("IRCMacroOpen=Yes") 
  409. tofile("IRCMacroOpen=No")
  410. #fileopen
  411. "XOS_CLI","SetType IRCMacro:Resources.Options FFF"
  412. RedrawWindows
  413. "Wimp_ForceRedraw",-1,-1000,-1000,6000,6000
  414. tofile(tofile$)
  415.  output
  416.  tofile$="" 
  417.  pos%=1
  418. (tofile$)
  419. output=
  420. tofile$,pos%,1)
  421.  output=13 
  422.  output=10 output=
  423. #fileopen,output
  424. #fileopen,13
  425. LoadNewDefinitions(name$)
  426. LoadIRCMacros(name$)
  427. RedrawWindows
  428. SaveDefs
  429. SaveIRCMacros
  430. SaveIRCMacros
  431. "XOS_CLI","Copy <IRCMacroScripts$Dir>.Script <IRCMacroScripts$Dir>.^.Backup.Script A ~C ~D F ~L ~N ~P Q ~R ~S ~T ~V"
  432. -fileopen=
  433.  "<IRCMacroScripts$Dir>.Script"
  434.  loop=1
  435. -loop$=
  436. (loop):
  437.  loop<10 
  438.  loop$="0"+loop$
  439. temp$=
  440. Readircmacro(loop-1)
  441. tofile("IRCTag"+loop$+"="+temp$)
  442. tofile("IRCDef"+loop$+"="+ircmacro$(loop))
  443. #fileopen
  444. "XOS_CLI","SetType <IRCMacroScripts$Dir>.Script FFF"
  445. Readircmacro(icon)
  446. !block%=ircmacrohandle
  447. block%!4=icon
  448. "Wimp_GetIconState",,block%
  449. =$(block%!28)
  450.